package cn.iocoder.yudao.module.member.dal.mysql.jobcollection;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.member.controller.admin.job.vo.AppJobRespVO;
import cn.iocoder.yudao.module.member.dal.dataobject.jobcollection.JobCollectionDO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.member.controller.admin.jobcollection.vo.*;
import org.apache.ibatis.annotations.Param;

/**
 * 我的收藏 Mapper
 *
 * @author Alan
 */
@Mapper
public interface JobCollectionMapper extends BaseMapperX<JobCollectionDO> {

    default PageResult<JobCollectionDO> selectPage(JobCollectionPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<JobCollectionDO>()
                .eqIfPresent(JobCollectionDO::getUserId, reqVO.getUserId())
                .eqIfPresent(JobCollectionDO::getJobId, reqVO.getJobId())
                .betweenIfPresent(JobCollectionDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(JobCollectionDO::getId));
    }

    IPage<AppJobRespVO> getAppJobCollectionPage(@Param("page")Page<AppJobRespVO> page, @Param("vo") JobCollectionPageReqVO pageReqVO);
}